package com.ruoyi.web.controller.bussiness;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.entity.po.TJudges;
import com.ruoyi.service.IJudgesService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


@RestController
@RequestMapping("/judges")
@Api(tags = "PC-4.评委管理")
public class JudgesController extends BaseController {
    
    @Autowired
    private IJudgesService judgesService;

    @GetMapping("/list")
    @ApiOperation("评委列表")
    public TableDataInfo list(TJudges judges) {
        startPage();
        List<TJudges> list = judgesService.selectJudgesList(judges);
        return getDataTable(list);
    }

    @PostMapping("/add")
    @ApiOperation("添加评委")
    public AjaxResult add(@RequestBody TJudges judges) {
        return toAjax(judgesService.insertJudges(judges));
    }
}

